#!/bin/bash

mkdir /mnt/config -p
mkdir /tmp/ipc/shmem -p
mkdir /tmp/ipc/msgqueue/peer -p


# 启动mqtt进程
gnome-terminal -- sh -c 'bash -c "cd ~; mosquitto; exec bash"'
sleep 1

# 启动视频流
xterm -T "Process stream" -e "cd ~/mjpg-streamer;  ./mjpg_streamer -i \"./input_uvc.so -r 320x240\" -o \"./output_udp.so -p 8887\" -o \"./output_http.so -w ./www\"" &


#设备响应
gnome-terminal -- sh -c 'bash -c "cd ~/24022/smartfactory/finddev;  sudo ./test; exec bash"'
sleep 1

#上报进程
gnome-terminal -- sh -c 'bash -c "cd ~/24022/smartfactory/up;  ./test; exec bash"'
sleep 1

#32进程
gnome-terminal -- sh -c 'bash -c "cd ~/24022/smartfactory/stm32; ./test; exec bash"'
sleep 1

#modbus进程
gnome-terminal -- sh -c 'bash -c "cd ~/24022/smartfactory/modbus;  ./modbus; exec bash"'
sleep 1


#阿里云进程
gnome-terminal -- sh -c 'bash -c "cd ~/24022/smartfactory/LinkSDK;  ./output/data-model-basic-demo; exec bash"'
sleep 1

#web进程
gnome-terminal -- sh -c 'bash -c "cd ~/24022/smartfactory/web/thttpd-master;  sudo ./thttpd.out; exec bash"'
sleep 1
